package com.wallet.crypto.trustapp.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.wallet.crypto.trustapp.R;

/**
 * Created by lingjianzhong on 2018/5/10.
 */

public class PromptActivity extends BaseActivity {
    private View mNavigation;
    private View mPrompt;
    private ImageView mClose;
    private View mLine;
    private TextView mTitle;
    private TextView mContent;
    private String title;
    private String content;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_prompt);
        initValue();
        initView();
    }

    private void initValue() {
        Intent intent = getIntent();
        title = intent.getStringExtra("title");
        content = intent.getStringExtra("content");
    }

    private void initView() {
        mNavigation = findViewById(R.id.navigation_top);
        mPrompt = findViewById(R.id.prompt_top);
        mLine = mNavigation.findViewById(R.id.top_line);
        mLine.setVisibility(View.INVISIBLE);
        mClose = mNavigation.findViewById(R.id.top_icon);
        mTitle = mPrompt.findViewById(R.id.prompt_title);
        mContent = mPrompt.findViewById(R.id.prompt_content);

        mClose.setImageResource(R.drawable.ic_chevron_left_black_24dp);
        mTitle.setText(title);
        mContent.setText(content);
        mClose.setOnClickListener(this::OnCloseListener);
    }


    private void OnCloseListener(View view) {
        finish();
    }
}
